31d80d6
@@ -128,7 +128,10 @@
public static Date timeToDate(long l) {
   public static long daysToMillis(int d) {
     // Convert from day offset to ms in UTC, then apply local timezone offset.
     long millisUtc = d * MILLIS_PER_DAY;
-    return millisUtc - LOCAL_TIMEZONE.get().getOffset(millisUtc);
+    long tmp =  millisUtc - LOCAL_TIMEZONE.get().getOffset(millisUtc);
+    // Between millisUtc and tmp, the time zone offset may have changed due to DST.
+    // Look up the offset again.
+    return millisUtc - LOCAL_TIMEZONE.get().getOffset(tmp);
   }
 
   public static int dateToDays(Date d) {
